
/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"8FCA7EB6-612C-428E-BD64-A8AC68EA357B"}
 */
function anterior(event) {
	var $actual = controller.getSelectedIndex()
	if ($actual == 1)
		controller.setSelectedIndex(controller.getMaxRecordIndex())
	else
		controller.setSelectedIndex($actual - 1)
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"39D0D6FB-A137-402B-AB38-1E716E46CEB1"}
 */
function siguiente(event) {
	var $actual = controller.getSelectedIndex()
	if ($actual == controller.getMaxRecordIndex())
		controller.setSelectedIndex(1)
	else
		controller.setSelectedIndex($actual + 1)
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"5890C843-2E8F-4A0A-B7BD-E7BE91BF76BA"}
 */
function cerrar(event) {
	var $win = application.getWindow('FOTOS_HAB')
	$win.hide()
	$win.destroy()
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"11649093-A596-4F8C-B5C7-A57750D64170"}
 */
function borrar(event) {
	var $resp = globals.DIALOGS.showQuestionDialog('Confirmación','¿Desea eliminar esta foto?','Si','No')
	if ($resp == 'Si')
	{
		controller.deleteRecord()
	}
}
